<%@ page language="java" import="java.util.*" pageEncoding="UTF-8"%>
<%@taglib prefix="s" uri="/struts-tags"%>
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
<HTML>
	<HEAD>
		<TITLE>Untitled Page</TITLE>
		<META http-equiv=Content-Type content="text/html; charset=utf-8">
		<META content="MSHTML 6.00.2900.5848" name=GENERATOR>
		<link href="../css/public.css" rel="stylesheet" style="text/css">
	</HEAD>
	<BODY style="BACKGROUND-POSITION-Y: -120px; BACKGROUND-IMAGE: url(../images/background.gif); BACKGROUND-REPEAT: repeat-x">
		<SCRIPT type=text/javascript>       
			function doPostBack() {
				document.enterprise.submit();
			}
			function turnpage(){
			var curPage=document.getElementById("page").value;
			if(isNaN(curPage)){
			window.location.href="pur_getById?pb.pageNo="+1;
			}
			else{
              window.location.href="pur_getById?pb.pageNo="+curPage;
             }
		   }
		    function addlist(productid,number,stockNumber){    
		    var cks = document.getElementById("cks"+productid).value;
		    if(isNaN(cks)){
		      alert("请输入正确的出库数量 ?");
		    }
		    else{
		       if(cks>stockNumber){
		       alert("库存数量不足 ?");
		       
		       }
		       else{
		        if(cks!=number){
		         if(confirm("商品数量和出库数量不相等,确认继续吗?")){
		              var test = "library_libraryAdd?commodityId="+productid+"&checkOutNumber="+cks;
		            location.href = test;
		          }
		        
		        }
		        else{
		           var test = "library_libraryAdd?commodityId="+productid+"&checkOutNumber="+cks;
		            location.href = test;
		        }
		       }
		    }
		    
		    
		 
		    }
		</SCRIPT>
		<SCRIPT src="EmployeeMgr.files/WebResource.axd" type=text/javascript></SCRIPT>
		<SCRIPT src="EmployeeMgr.files/ScriptResource.axd"
			type=text/javascript></SCRIPT>
		<SCRIPT src="/EmployeeMgr.files/ScriptResource(1).axd"
			type=text/javascript></SCRIPT>
		<DIV>
			<TABLE height="100%" cellSpacing=0 cellPadding=0 width="100%"
				border=0>
				<TBODY>
					<TR
						style="BACKGROUND-IMAGE: url(../images/bg_header.gif); BACKGROUND-REPEAT: repeat-x"
						height=47>
						<TD width=10>
							<SPAN
								style="FLOAT: left; BACKGROUND-IMAGE: url(../images/main_hl.gif); WIDTH: 15px; BACKGROUND-REPEAT: no-repeat; HEIGHT: 47px">
							</SPAN>
						</TD>
						<TD>
							<SPAN
								style="FLOAT: left; BACKGROUND-IMAGE: url(../images/main_hl2.gif); WIDTH: 15px; BACKGROUND-REPEAT: no-repeat; HEIGHT: 47px">
							</SPAN>
							<SPAN
								style="PADDING-RIGHT: 10px; PADDING-LEFT: 10px; FLOAT: left; BACKGROUND-IMAGE: url(../images/main_hb.gif); PADDING-BOTTOM: 10px; COLOR: white; PADDING-TOP: 10px; BACKGROUND-REPEAT: repeat-x; HEIGHT: 47px; TEXT-ALIGN: center; 0 px: ">
								<a href="library_createOrderNumber.action">返回</a> </SPAN><SPAN
								style="FLOAT: left; BACKGROUND-IMAGE: url(../images/main_hr.gif); WIDTH: 60px; BACKGROUND-REPEAT: no-repeat; HEIGHT: 47px"></SPAN>
						</TD>
						<TD
							style="BACKGROUND-POSITION: 50% bottom; BACKGROUND-IMAGE: url(../images/main_rc.gif)"
							width=10></TD>
					</TR>
					<TR>
						<TD style="BACKGROUND-IMAGE: url(../images/main_ls.gif)">&nbsp;
							
						</TD>
						<TD
							style="PADDING-RIGHT: 10px; PADDING-LEFT: 10px; PADDING-BOTTOM: 10px; COLOR: #566984; PADDING-TOP: 10px; BACKGROUND-COLOR: white"
							vAlign=top align=center>
							<DIV>
								<form action="" method="post" name="enterprise">
									<TABLE class=gridView id=ctl00_ContentPlaceHolder2_GridView1
										style="WIDTH: 100%; BORDER-COLLAPSE: collapse" cellSpacing=0
										rules=all border=1 >
										<TBODY>
											<TR>
												<TH class=gridViewHeader scope=col>
													订单编号
												</TH>

												<TH class=gridViewHeader scope=col>
													商品
												</TH>

												<TH class=gridViewHeader scope=col>
													商品数量
												</TH>

												<TH class=gridViewHeader scope=col>
													商品价格
												</TH>

												<TH class=gridViewHeader scope=col>
													生产厂家
												</TH>
												<TH class=gridViewHeader scope=col>
													库存数
												</TH>
												<TH class=gridViewHeader scope=col>
													备注
												</TH>
				     							<TH class=gridViewHeader scope=col>
													出库数
												</TH>
	     										<TH class=gridViewHeader scope=col>
													操作
												</TH>
											</TR>
											<s:iterator value="list">
											<tr>
												<TD class=gridViewItem>
													<s:property value="sn" />
												</TD>
												<TD class=gridViewItem>
													<s:property value="commodity.name" />
												</TD>
												<TD class=gridViewItem>
													<s:property value="number" />
												</TD>
												<TD class=gridViewItem>
													<s:property value="price" />
												</TD>
												<TD class=gridViewItem>
													<s:property value="commodity.factory" />
												</TD>
												<TD class=gridViewItem>
													<s:property value="stockNumber" />
												</TD>
												<TD class=gridViewItem>
													<s:property value="remark" />
												</TD>
												<TD class=gridViewItem>
													<input type="text" id="cks<s:property value="commodity.id" />" size="2" />
												</TD>
												<TD class=gridViewItem>
												     <input type="button" value="加入出库单" onClick="addlist('<s:property value="commodity.id" />','<s:property value="number" />','<s:property value="stockNumber" />')"/>
												</TD>
											</tr>
											</s:iterator>
										</TBODY>
								   
										 <TR>
									    <TD colspan="23" align="right" class=gridViewHeader>
									      &nbsp;
									    	<!-- /*总共有<s:property value="pb.count"/>条记录
									    	每页<s:property value="pb.pageSize"/>条记录
									    	当前为第<s:property value="pb.pageNo"/>页/
									    	总共有<s:property value="pb.totalPage"/>页
									    	<a class="a_a" href="library_findOrderById?pb.pageNo=1">第一页</a>
									    	<a class="a_a" href="pur_getOrderlistList?pb.pageNo=<s:property value="pb.prep"/>">上一页</a>
									    	<a class="a_a" href="pur_getOrderlistList?pb.pageNo=<s:property value="pb.nextp"/>">下一页</a>
									    	<a class="a_a" href="pur_getOrderlistList?pb.pageNo=<s:property value="pb.totalPage"/>">最后一页</a>
									    	转到第<input type="text" id="page" size="1"/>页<input type="submit" value="Go" onClick="javascript:turnpage();"/> -->
									   </TD>
								    </TR>	
									</TABLE>
									  </form>
									
									
									
									
								<TABLE class=gridView1 id=ctl00_ContentPlaceHolder2_GridView1
									style="WIDTH: 100%; BORDER-COLLAPSE: collapse" cellSpacing=0
									rules=all border=1 align="left">
                                           <TBODY>
                                             <TR>
                                               <TH width="50" class=gridViewHeader style="WIDTH: 50px" scope=col>&nbsp; </TH>
                                               <TH width="231" class=gridViewHeader scope=col>商品编号</TH>
                                               <TH width="212" class=gridViewHeader scope=col>商品名称</TH>
                                               <TH width="183" class=gridViewHeader scope=col>规格型号</TH>
                                               <TH width="67" class=gridViewHeader scope=col>单位</TH>
                                               <TH width="184" class=gridViewHeader scope=col>生产厂家</TH>
                                               <TH width="87" class=gridViewHeader scope=col>出库数量</TH>                                        
                                               <TH width="114" class=gridViewHeader scope=col>操作</TH>
                                             </TR>
                                             <s:iterator value="listSet">
                                             	<TR>
                                               <TD class=gridViewItem style="WIDTH: 50px"><IMG src="EmployeeMgr.files/bg_users.gif"> </TD>
                                               <TD class=gridViewItem><s:property value="commodity.sn"/></TD>
                                               <TD class=gridViewItem><s:property value="commodity.name"/></TD>
                                               <TD class=gridViewItem><s:property value="commodity.specifications"/></TD>
                                               <TD class=gridViewItem><s:property value="commodity.company"/></TD>
                                               <TD class=gridViewItem><s:property value="commodity.factory"/></TD>
                                               <TD class=gridViewItem><s:property value="quantity"/></TD>                       
                                               <TD class=gridViewItem><label>
                                                 <input name="Submit" type="button" class="buttonBlue" value="删除" onClick="location.href='library_libraryDelte.action?commodityId=<s:property value="commodity.id"/>'">
                                               </label></TD>
                                               </TR>
                                             </s:iterator>
                                       
                                           </TBODY>
                                         </TABLE>

							</DIV>
						</TD>
						<TD style="BACKGROUND-IMAGE: url(../images/main_rs.gif)"></TD>
					</TR>
					<TR
						style="BACKGROUND-IMAGE: url(../images/main_fs.gif); BACKGROUND-REPEAT: repeat-x"
						height=10>
						<TD style="BACKGROUND-IMAGE: url(../images/main_lf.gif)"></TD>
						<TD style="BACKGROUND-IMAGE: url(../images/main_fs.gif)"><br></TD>
						<TD style="BACKGROUND-IMAGE: url(../images/main_rf.gif)">
							<br>
						</TD>
					</TR>
				</TBODY>
			</TABLE>
		</DIV>
		<SCRIPT type=text/javascript>
	//         
	Sys.Application.initialize();
	//
</SCRIPT>
	</BODY>
</HTML>
